import { BaseWindow } from "../../../../component/window/BaseWindow";
import { ILayer } from "../../../../mvc/interfaces/ILayer";
import { Language } from "../../../../../extend/language/Language";
import { ObjCreate } from "../../common/ObjCreate";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { PageItemRenderer } from "../../common/renderers/PageItemRenderer";
import { ScrollPolicy } from "../../../../../fl/controls/ScrollPolicy";
import { DataProvider } from "../../../../../fl/data/DataProvider";
import { GlobalSkin } from "../../../../component/skin/GlobalSkin";
import { GameProxy } from "../../../mvc/GameProxy";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
import { GTileList } from "../../../../../com/mui/controls/GTileList";
import { GButton } from "../../../../../com/mui/controls/GButton";
//class LevelSealRewardsPanel
    
    export  class LevelSealRewardsPanel extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            this.setSize(360, 225);
            this.titleHeight = 25;
            this.title = Language.getString(60466);
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            ObjCreate.createBg(20, 38, 320, 175, this);
            this._tip = ObjCreate.createGTextField("ddd:", 30, 50, 300, 20, this, GlobalStyle.textFormat6);
            this._rewards = ObjCreate.createTileList(75, 80, 210, 85, this);
            this._rewards.setStyle("cellRenderer", PageItemRenderer);
            this._rewards.rowHeight = 41;
            this._rewards.columnWidth = 41;
            this._rewards.scrollPolicy = ScrollPolicy.OFF;
            this._rewardsDp = new DataProvider();
            this._rewards.dataProvider = this._rewardsDp;
            this._btn = ObjCreate.createGButton(Language.getString(90000), 140, 175, 80, 28, this, GlobalSkin.ButtonRed);
            this._btn.addEventListener(flash.events.MouseEvent.CLICK, this.onBtnClickHandler);
            return;
        }

        public setTips(arg1: string): void
        {
            this._tip.htmlText = arg1;
            return;
        }

        public setRewards(arg1: Array<any>): void
        {
            this._rewardsDp.removeAll();
            this._rewardsDp.addItems(arg1);
            this._rewards.dataProvider = this._rewardsDp;
            return;
        }

        /* internal  */onBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            GameProxy.copy.getCopySealItem(1);
            return;
        }

        /* internal */ /* var */_tip: GTextFiled;

        /* internal */ /* var */_rewards: GTileList;

        /* internal */ /* var */_btn: GButton;

        /* internal */ /* var */_rewardsDp: DataProvider;
    }
